from re import *
from math import *
import hashlib
import os
import sys


class engine:
	def __init__(self,cht,runtime,chtDamage,mixDamage,engineNumber):
		self.defaultcht=cht
		self.runtime=runtime
		self.chtDamage=chtDamage
		self.engineNumber=engineNumber


	def clearEng(self):
		self.runtime=0
		self.chtDamage=0
		self.mixtureDamage=0

	def currentRPM(self):
		return 20

	def currentCHT(self):
		return 200

	def currentMIX(self):
		return 20

	def planeALT(self):
		return 20

	def feed(self,sec,rpm,mix,cht,altitude):
		if rpm>0:
			self.runtime+=sec
		if self.defaultcht>0:
			_diff=abs(cht-self.defaultcht)/float(sec)
			if _diff>0:
				self.chtDamage+=_diff
		self.defaultcht=cht
		if (mix > 95 and altitude > 1000):
			self.mixtureDamage += sec

	def getData(self):
		return "&mixture"+str(self.engineNumber+1)+"="+str(self.mixtureDamage)+"&heat"+str(self.engineNumber+1)+"="+str(self.chtDamage)+"&time"+str(self.engineNumber+1)+"="+str(self.runtime)


ACEngine=[]
NumberOfEngines = 5

for _iengApp in range(NumberOfEngines):
	ACEngine.append(engine(10,0,0,0,_iengApp))

	
print ACEngine

for ienga in range(len(ACEngine)):
	print ACEngine[ienga].currentRPM()

					
				
